
FILESYSTEM
----------

Directories are just files with a this structure in repetition (40 bytes)

typedef struct
{
	char name[32];
	int size;
	int start;

} __attribute__ ((packed)) Romfile;

Note that the top-bit of size is set if the target is a directory.
The start-field is always relative the location of the root-dir
in memory

To locate the rootdir in memory:

Following the bin (adress always even 32KByte) is this data:

0: 0xFAB0BABE
4: <size of rootdir>
8: Romfile file1
   Romfile file2
   etc

So an application should look for the magic-word at even 32KByte
boundries...


COMMANDLINE ARGUMENTS
---------------------
Are copied to the last KByte of EWRAM (0x0203FC00) in this format:
0: 0xFAB0BABE
4: <number of arguments>
8: Argument0, zero-terminated
   Argument1, zero-terminated

etc..
(First argument is commandname).
If you handle arguments you should clear the FAB0BABE word so
another program doesn't find it later.

(non-libpogo applications can get a pointer to the file in the first
argument by just looking at the 32bit word before the 0xFAB0BABE word).


ICONS
-----
uchar width;
uchar height;
uchar pixels[width*height];


FONT
----
uint16 flags;
uchar first;		// First character in font
uchar last;			// Last character in font
uchar charwidth;	// Only for space in proportional fonts
uchar height;		// Height of a letter in pixels
uint16 width;		// Width of all letter in pixels
uchar planar_pixels[((width+31)&0xFFFFFFC0*height)/8];
uint16 offsets[last-first+1]; // One offset for each letter (only for proportional fonts)

Planar data is 1bit data of all letters from left to right, aligned so width is even 32bit
flags = 1 means proportional



SRAM FILESYSTEM
---------------

0: "MINSF2" 0 0
8: Pointer to firstfile
12: Pointer to gapfile


All files (from first) starts with this structure
followed by filedata
Last files has next = NULL
First file is always "DUMMY" and should never be erased/moved


typedef struct _SRamFile
{
	struct _SRamFile *next;
	char name[32];
	uint16 flags;
	uint32 length;
} SRamFile;

